﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Marvin.Tests.TrainingSetTests
{
    [TestClass]
    public class ContainsOnlyValidDataPoints
    {
        private TrainingSet<double> _trainingSet;
        private static readonly double[] FiveDimensionalDatum = new[] { 1.0, 2.0, 3.0, 4.0, 5.0 };
        private static readonly double[] ThreeDimensionalDatum = new[] { 1.0, 2.0, 3.0 };
        private const int NumberOfTrainingExamples = 10; 

        [TestInitialize]
        public void InitializeFourDimensionalTrainingSet()
        {
            _trainingSet = new TrainingSet<double>(4, NumberOfTrainingExamples);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void AddFiveDimensionalDataPointToAFourDimensionalTrainingSetThrowsAnException()
        {
            _trainingSet.Add(FiveDimensionalDatum, 0.0);
        }
        
        [TestMethod]
        [ExpectedException(typeof(ArgumentException))]
        public void AddThreeDimensionalDataPointToAFourDimensionalTrainingSetThrowsAnException()
        {
            _trainingSet.Add(ThreeDimensionalDatum, 0.0);
        }
    }
}
